import { defineStore } from 'pinia'

const user = defineStore('user', {
    state: function () {
        return {
            token: '',
            info: {
                status: 0,
                nickname: 'OSAdmin',
                avatar: ''
            }
        }
    },
    getters: {},
    actions: {
        setToken(token: string) {
            this.token = token
        },

        changeInfo(status: number, nickname: string, avatar: string) {
            this.info = { status, nickname, avatar }
        }
    }
})

export default user
